import {export_json_to_excel} from '../vendor/Export2Excel'
import fmUtil from './formatUtil'

export default class ExcelUtil{
    static exportJsonToExcel (tHeader,filterVal,list,fileName) {
        return new Promise((resolve, reject) => {
            const data = fmUtil.formatJson(filterVal, list)
            export_json_to_excel({
                header: tHeader,
                data,
                filename: fileName,
                autoWidth: true
            })
            resolve()
        })

    }
}
